import React, {Component} from "react";
import {Link} from "react-router-dom";
import {inject, observer} from "mobx-react";
import {action} from "mobx";

@inject("queryStore")
@observer
class QueryFail extends Component {
    constructor(props) {
        super(props);
        this.handleClick = this.handleClick.bind(this);
    }

    @action handleClick() {
        // this.props.queryStore.setAccurateQuery(false);
        this.props.queryStore.setFlag(-1);
    }

    render() {
        return (
            <div className="Fail">
                <div className="Title">查询结果</div>
                <div>
                    <div className="Sorry">很抱歉，没有查询到匹配的结果</div>
                    <div className="Ask">是否继续查询?</div>
                    <div>
                        <Link to='/queryAlumnu/AccurateQuery'>
                            <button className="Accurate_btn" onClick={this.handleClick}>是</button>
                        </Link>
                        <Link to='/queryAlumnu'>
                            <button className="Accurate_btn">否</button>
                        </Link>
                    </div>
                </div>
            </div>
        )
    }
}

export default QueryFail;